<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>实验桌使用状态</title>
    <link rel="stylesheet" href="/my/bootstrap.min.css">
    <script src="/my/jquery.min.js"></script>
    <script src="/my/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <h2 style="text-align: center;">实验桌使用中</h2>
    <hr>
    <form class="form-horizontal">

        <input type="hidden"    id="id" name="id"    th:value="${stuRecorder.id}"  >



        <div class="form-group">

           <h3>
                <span class="form-control-static"    th:text="${stuRecorder.userName}"  > </span>

                <span>正在使用</span>

                <span class="form-control-static"    th:text="${stuRecorder.deskid}"  > </span>


                <span>号实验桌</span>

           </h3>


        </div>



        <div class="form-group">
            <!--  <div class="col-sm-offset-4 col-sm-4">
                  <button type="button" class="btn btn-primary form-control" id="changeStatus">修改状态</button>
              </div>-->


            <div class="form-group">
                <label for="endstatus">设备目前状况：</label>
                <input type="text" required="required" value="正常" style="width: 50%;    height: 50px; "  class="form-control" id="endstatus" name="endstatus" placeholder="设备目前状况">
            </div>




            <div class="form-group">


                <button type="button" style="width: 100% ;  font-size: 30px ; margin-top: 10px  "   id="endUsage"  class="btn btn-info  myinput">结束使用</button>

            </div>
        </div>
    </form>
</div>
<script>
    $(function() {
// 结束使用
        $('#endUsage').click(function() {
            if (confirm('确定要结束使用吗？')) {
                $.ajax({
                    type: "POST",
                    url: "/enduse",
                    data: { id: $('#id').val() , endstatus:  $('#endstatus').val()  },
                    success: function(result) {

                      window.location.href="/end";

                //        alert('已成功结束使用！');
                     //   window.close();
                    }
                });
            }
        })
    });
</script>
</body>
</html>